#ifndef PHOTONMAP
#define PHOTONMAP

#include <iostream>
#include "Photon.h"
#include "Ray.h"
#include "Vector3.h"
#include "SurfaceObject.h"
#include "KDTree.h"
#include "SceneStructure.h"
#include "LightSource.h"

//using namespace std;

class PhotonMap {

    public:
    PhotonMap(SceneStructure&);
    void CreatePhotonMap(int TotalAmount, float, vector<SurfaceObject*>&, vector<LightSource*>&);
    void EmitPhotonsFromLightSource(LightSource, int, vector<SurfaceObject*>&, float);
    vector<Photon*> FindClosestPhotons(Vector3 Position, int amount, float max_distance) { return _KDStructredPhotonMap->FindClosestPhotons(Position, amount, max_distance); }

    private:
    bool PhotonTrace(Photon&, int&, Ray, Vector3);
    SceneStructure * _CurrentScene;
    KDTree * _KDStructredPhotonMap;
    vector<Photon> _photonMap;
    vector<Photon*> * _photonMap_ref;
};


#endif





